/*!
\file
\brief
	Declaration of MethodInfo.
\details
\bug
	none
\todo
	none
\date
	January 20, 2008 - first version of the file.
\author
	Copyright (C) 2008 Vadym Hulakov, mailto:hulakov@gmail.com. All rights reserved.
*/

#ifndef METHODINFO_H
#define METHODINFO_H

#include <string>
#include <vector>

#include "ItemBase.h"
#include "ClassMemberAccess.h"
#include "Type.h"
#include "Variable.h"

namespace ObjectModel
{
	//! Description of method of the class.
	class Method : public ItemBase
	{
	private:
		friend class ClassType;

		Method(const wchar_t* name, const Type& returnType, bool isPure,
			ClassMemberAccess access, const wchar_t* description);

		//@}
	public:

		//! @name Properties
		//@{
		//! Get return type of the method.
		//! @return
		//!		Return type of method.
		const Type& getReturnType() const { return *_returnType; }

		//! Get access rights to method.
		//! @return
		//!		Access rights to method.
		ClassMemberAccess getAccess() const { return _access; }

		//@}

		//! @name Work with parameters
		//@{
		typedef std::vector<Parameter> Parameters;

		//! Get all attributes of type.
		const Parameters& getParameters() const { return _parameters; }

		//! Add attribute.
		Parameter& addParameter(const wchar_t* name, Type& type,
			ClassMemberAccess access = ClassMemberAccessPrivate,
			const wchar_t* description = 0);

		//@}

		bool isPure() const { return _isPure; }

	private:
		const Type* _returnType;
		ClassMemberAccess _access;
		Parameters _parameters;
		bool _isPure;
	};
}

#endif // METHODINFO_H
